/*
day381 
2020.9.12 
*/
#include<iostream>
#include<vector>
using namespace std;

class Solution {
public:
    int diagonalSum(vector<vector<int>>& mat) {
		int res=0;
		for(int i=0;i<mat.size();++i)
		{
			res+=mat[i][i];
			res+=mat[i][mat.size()-i-1];
		}
		
		if(mat.size()%2==1)
		{
			int haf=(mat.size()-1)/2;
			res-=mat[haf][haf];
		}
		
		return res;
    }
};

int main()
{
	return 0;
 } 
